$N.databaseSet.AlarmClocks = (function ($N) {    
    function init() {
    	var tableName = "AlarmClocks";
    	var fields = new Array("personID varchar(15),\
    							startTime varchar(50), \
                                cycle varchar(50),\
                                description varchar(100),\
                                clockID varchar(30)
                                answer varchar(20),\
                                created datetime");

    	$N.databaseSet.createTableWithPrimaryKey(tableName, fields, "id", function () {
    		console.log("AlarmClocksTable is created successfully");
    	});
    }

    
    function addAlarmClocksData(data, successCallback, errorCallback) {
        var sqlCommand =  "INSERT INTO AlarmClocks " + "(personID, startTime, cycle, description,clockID,answer,created) \
						        values(?, ?, ?, ?,?,?,?)";
        var sqlValueArray =new Array(data.personID, data.startTime, data.cycle, data.description, dat.clockID, data.answer, data.created);
        $N.databaseSet.executeSQL($N.databaseSet.db, sqlCommand, sqlValueArray, successCallback, errorCallback);
    }

	function getAlarmClocksData(personID, successCallback, failCallback) {
		var db = $N.databaseSet.db;
		var sqlCommand = "SELECT * FROM AlarmClocks WHERE personID = ?";
		$N.databaseSet.executeSQL(db, sqlCommand, [personID], successCallback, failCallback);
	}

    
	return {
        init:           init,
		getAlarmClocksData : getAlarmClocksData,
        addAlarmClocksData : addAlarmClocksData,
     
	}

}
	($N));